Solving two linear systems Ax=b